package servlet;
import servlet.Connections;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.RequestDispatcher;

public class selectUsers 
{
	public ArrayList selUsers()
	{
	Connections conn=new Connections();
	Statement stmt=null;
	ResultSet rs=null;
	
	ArrayList userData=new ArrayList();
	
	String query="select * from login";

	String database,url,userid,userpwd,driver;
    
    try
	{
    	stmt=conn.getConnection().createStatement();
		rs=stmt.executeQuery(query);
					
		while(rs.next())
		{
			userData.add(rs.getString(1));
		}
		
		rs.close();
		stmt.close();
		conn.getConnection().close();
	}

	catch(Exception e)
	{
		e.printStackTrace();
	}
	return userData;

	
	}
}
